<template>
  <el-dialog
    :title="title"
    :visible="visible"
    width="1300px"
    :before-close="closeForm"
    :modal-append-to-body="false"
    :modal="false"
    :close-on-click-modal="false"
  >
    <userForm :form-id="formId" :is-show-btn="false" :is-load="visible" @load="load" />
  </el-dialog>
</template>

<script>
import userForm from '../userForm/userForm.vue'
export default {
  components: {
    userForm
  },
  props: {
    formId: {
      type: String,
      default: null
    },
    visible: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      title: '表单预览'
    }
  },
  computed: {},
  mounted() {
  },
  methods: {
    load(data) {
      this.title = data.FormName
    },
    closeForm() {
      this.$emit('update:visible', false)
      this.$emit('close')
    }
  }
}
</script>
